\begin{tikzpicture}
    \tikzset{
        yuanzhu/.pic = {
            \pgfmathsetmacro{\angle}{45}
            \pgfmathsetmacro{\len}{2}
            \pgfmathsetmacro{\r}{0.2}

            \coordinate (O) at (0, 0);
            \coordinate (O') at ({\len * cos(\angle)},  {\len * sin(\angle)});
            \coordinate (dA) at ({\r * cos(90 + \angle)}, {\r * sin(90 + \angle)});
            \coordinate (dB) at ({\r * cos(270 + \angle)}, {\r * sin(270 + \angle)});

            \draw [fill=white] (O) circle (\r);
            \draw [fill=white]
                ($(O) + (dA)$) -- ($(O') + (dA)$)
                arc [start angle=90 + \angle, end angle=-90 + \angle, radius=\r]
                -- ($(O) + (dB)$)
                arc [start angle=-90 + \angle, end angle=90 + \angle, radius=\r];
        }
    }

    \begin{scope}
        \foreach \y in {1,...,6}
            \foreach \x [parse=true] in {1,...,10-\y}
                \draw (0.2*\y+0.4*\x,0.33*\y) pic{yuanzhu};

    \draw[decorate,decoration={brace,mirror,amplitude=0.2cm}] (4.4, 3.7) -- (3.0, 3.7)
        node [pos=0.5, above=0.4em, align=center] {$a$};
    \draw[decorate,decoration={brace,mirror,amplitude=0.2cm}] (0.4, 0) -- (4, 0)
        node [pos=0.5, below=0.3em, align=center] {$b$};
    \draw[decorate,decoration={brace,mirror,amplitude=0.2cm}] (1.4, 2.2) -- (0.3, 0.4)
        node [pos=0.5, above left=0.3em, align=center] {$n$};
    \node at (2, -0.8) {（1）};
    \end{scope}

    \begin{scope}[xshift=5cm]
        \foreach \y in {1,...,6}
            \foreach \x [parse=true] in {1,...,10-\y}
                \draw (0.2*\y+0.4*\x,0.33*\y) circle(0.2);
        \foreach \y in {1,...,6}
            \foreach \x [parse=true] in {1,...,3+\y}
                \draw [densely dotted] (4-0.2*\y+0.4*\x,0.33*\y) circle(0.2);
        \node at (3, -0.8) {（2）};
    \end{scope}
\end{tikzpicture}
